<template>
    <div class="iframe">
        <div class="i-title">
            <h3>父与子传参（自取名）</h3>
        </div>
        <cc />
    </div>
</template>

<script setup lang="ts">
import { reactive, provide } from "vue";
import cc from "../p1/cc.vue";

interface Person {
    name: string,
    age: number
}

const person: Person = reactive({
    age: 18,
    name: "tgrong"
})

provide<Person>("p1", person)

//父组件修改数据
setTimeout(() => {
    person.name = "程序世界";
}, 3000)

</script>
